# $Id: PKGBUILD 180205 2013-03-18 16:09:12Z andyrtr $
#Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xf86-video-neomagic
pkgver=1.2.7
pkgrel=5
pkgdesc="X.org neomagic video driver"
arch=(i686 x86_64)
url="http://xorg.freedesktop.org/"
license=('custom')
depends=('glibc')
makedepends=('xorg-server-devel' 'X-ABI-VIDEODRV_VERSION=14' 'resourceproto' 'scrnsaverproto')
conflicts=('xorg-server<1.14.0' 'X-ABI-VIDEODRV_VERSION<14' 'X-ABI-VIDEODRV_VERSION>=15')
groups=('xorg-drivers' 'xorg')
options=('!libtool')
source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2
        git-fixes.patch
        shadowfb.patch)
sha256sums=('9f06e89ea68afb65dbc064af63dc57d3606fc7244cd62cf87841ff5bbc98cb76'
            '38b67ce2b0ff94f68c8e1f221759fd7e2059383f4dac716356b5ef2ad695507e'
            'cf7e49f51869efdb22ee8d6e85bf0f557e22f08072e6d90a4dba3e39feabbf36')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -Np1 -i "${srcdir}/git-fixes.patch"
  # workaround to get it work again https://bugs.archlinux.org/task/32604
  patch -Np1 -i ${srcdir}/shadowfb.patch
  autoreconf
  ./configure --prefix=/usr
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -d -m755 "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
